<!-- head -->
{include file='public/head' /}
<!-- head -->

<!-- left -->
{include file='public/left' /}
<!-- left -->

<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
        <h1>
            管理后台
            <small>1.0.0</small>
        </h1>
        <ol class="breadcrumb">
        </ol>
    </section>

    <!-- Main content -->
    <section class="content">
        <div class="row">
            <div class="col-sm-12">
                <div class="box box-default">
                    <div class="box-header with-border">
                        <h3 class="box-title">编辑权限</h3>
                    </div>
                    <form class="form-horizontal" id="form"  method="post" action="{:url('admin/role/savePermission','','')}">
                        <input name="id" type="hidden" id="id" value="{$id}">
                        {volist name="permissionList" id="v"}

                        <div class="box-body">
                            <div class="form-group">
                                <label for="username" class="col-sm-2 control-label">{$v.name}</label>
                                <div class="col-sm-10">
                                    {volist name="v.child" id="vv"}
                                    <label class="checkbox-inline">
                                        <input type="checkbox" id="permission" name="permission[]" value="{$vv.id}" {php} if(in_array($vv->id,$permission1)){ echo 'checked';} {/php} >{$vv.name}
                                    </label>
                                    {volist name="vv.child" id="vvv"}
                                    <label class="checkbox-inline">
                                        <input type="checkbox" name="permission[]" value="{$vvv.id}" {php} echo 111; if(in_array($vvv->id,$permission1)){ echo 'checked';} {/php}> {$vvv.name}
                                    </label>
                                    {/volist}
                                   {/volist}
                                </div>
                            </div>

                        </div>
                        {/volist}
                </div> <div class="box-footer" style="text-align:right;">
                <button type="button" class="btn btn-sm btn-primary" id="back">返回</button>
                            <button type="submit" class="btn btn-sm btn-primary" id="saveForm">保存</button>

                    </form>
                </div>
            </div>
        </div>
    </section>
    <!-- /.content -->
</div>
<!-- /.content-wrapper -->

<script type="text/javascript">
    $('#back').click(function(){
        location.href='/admin/role/index.html';
    });


</script>

<!-- right -->
{include file='public/right' /}
<!-- right -->

<!-- foot -->
{include file='public/foot' /}
<!-- foot -->
